package com.blog.blog.service.impl;

import com.blog.blog.dto.SaveTagDTO;
import com.blog.blog.mapper.TagMapper;
import com.blog.blog.service.TagService;
import org.springframework.stereotype.Service;

@Service
public class TagServiceImpl implements TagService {
    private final TagMapper tagMapper;

    public TagServiceImpl(TagMapper tagMapper) {
        this.tagMapper = tagMapper;
    }

    @Override
    public boolean create(SaveTagDTO dto) {
        return tagMapper.insert(dto) > 0;
    }

    @Override
    public boolean update(Long id, SaveTagDTO dto) {
        return tagMapper.update(id, dto) > 0;
    }

    @Override
    public boolean delete(Long id) {
        return tagMapper.delete(id) > 0;
    }
}


